package com.ayu.scalalearn.chapter05

/**
  * @Author 徐林玉
  * @Description ControlAbstraction
  * @Date 2022/7/28 10:00
  * @Version 1.0
  */
object Test03ControlAbstraction {

  def main(args: Array[String]): Unit = {

    //1、控制抽象1 传值参数

    def f0(a: Int): Unit = {

      println("a ==> " + a)
      println("a ==> " + a)
    }

    def f1(): Int = {

      println("f1调用")
      23
    }

    f0(1)
    f0(f1())
    println("==========================>")


    //控制抽象 2 传名参数 传递不再是具体的值而是代码块
    def f2(a: => Int): Unit = {
      println("a ==> " + a)
      println("a ==> " + a)
    }

    f2(f1())


  }

}
